#include <stdio.h>

int main()
{
	int n = 0;
	int i = 2;
	scanf("%d", &n);
	while ( n % i != 0 ) {
		i++;
	}
	int k = n / i;
	if ( k < i ) {
		k = i;
	}
	printf("%d", k);
	return 0;
}

